var http = require("./mymodal");
var path = require("path");
// var data = require("./data/collectById.json");
var Book = require("./mongo");
var express = require("express");
var mongoose = require("mongoose");
var app = express();
var assert = require("assert");
var bodyParser = require("body-parser");
mongoose.Promise = global.Promise;
var db = "mongodb://localhost:27017/test"
var datalist = require("./datalist")(app,express);
mongoose.connect(db)
mongodb: //localhost:27017/test");
    var port = 8080;
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
    extended: true
}));
app.get('/', function(req, res) {
    res.json({
        msg: 'hello'
    });
});

app.listen(port, function() {
    console.log("this app runing on port" + port);
});
